(function () {
    function datadetailsDialog(editor) {
    return {
        title: `添加属性`,
        minWidth: 300,
        minHeight: 80,
        buttons: [
            // {
            //     type: 'button',
            //     id: 'someButtonID',
            //     label: 'Button',
            //     onClick: function () {
            //         alert('This is a custome button');
            //     }
            // },
        CKEDITOR.dialog.okButton, 
        CKEDITOR.dialog.cancelButton],
        contents:                  
        [
            {
                id: 'user',
                label: 'You name',
                title: 'You name',
                elements:
                [
                    {
                        type: 'checkbox',
                        id: 'agree',
                        label: '启用用明细属性',
                    }
                ]
            }
        ],
        onLoad: function () {
            
        },
        onShow: function () {
            console.log(editor.getSelection().getStartElement().$.localName)
        },
        onHide: function () {
        
        },
        onOk: function () {
            // var name = this.getValueOf( 'user', 'name' );
            // editor.insertHtml('<p>' + name + ' : Hello world!' + '</p>');
           
            // //将内容放入到editor
            // this.commitContent();
        },
        onCancel: function () {
            
        },
        resizable: CKEDITOR.DIALOG_RESIZE_HEIGHT
    };
}

CKEDITOR.dialog.add('datadetailsDialog', function (editor) {
    return datadetailsDialog(editor);
});
})()